##from Tkinter import *
##
##class App:
##
##    def __init__(self, master):
##
##        frame = Frame(master)
##        frame.pack()
##
##        self.button = Button(frame, text="QUIT", fg="red", command=frame.quit)
##        self.button.pack(side=LEFT)
##
##        self.hi_there = Button(frame, text="Hello", command=self.say_hi)
##        self.hi_there.pack(side=LEFT)
##
##    def say_hi(self):
##        print "hi there, everyone!"
##
##root = Tk()
##
##app = App(root)
##
##root.mainloop()
import Tkinter as tk
import tkFileDialog as fd

def main():
    t = tk.Tk()
    t.withdraw()  # hides the Tk root window''
    d = fd.askopenfilenames() # display the dir dialog
    #print dir(fd)
    #print d
    
    d = encoder(d)
    
    d = t.tk.splitlist(d)
    
    laskuri = 0
    lopetus = len(d)
    while(laskuri < lopetus):
        
    
##    for i in range(0, len(d)):
##        tiedosto = d[i]
##        print tiedosto
##        index = tiedosto.rfind("/", 0, len(d))
##        #print index
##        tiedNimi = tiedosto[index+1:]
##        #print tiedNimi
    
    #index = d.rfind("/", 0, len(d))
    #print index

def encoder(string):
    if(string != None):
        return string.encode('latin-1')
    
#tiedNimi = d[index+1:]
#print tiedNimi

##['Dialog', 'Directory', 'Open', 'SaveAs', '_Dialog', '__builtins__', '__doc__','__file__',
##        '__name__', 'askdirectory', 'askopenfile', 'askopenfilename', 'askoenfilenames', 'askopenfiles',
##        'asksaveasfile', 'asksaveasfilename']

main()
